package com.slj.cloudaibaba.service;

import com.slj.cloudaibaba.entity.PayEntity;
import com.slj.cloudaibaba.repository.PayRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PayService {
    @Autowired
    private PayRepository payRepository;

    public void save(PayEntity payEntity) {
        if (payEntity.getPrice().equals(-1)) {
            throw new RuntimeException("aaaa");
        }
        payRepository.save(payEntity);
    }

    public List<PayEntity> findAll() {
        return payRepository.findAll();
    }
}
